<!DOCTYPE html>
<html>
<head>
    <title>会员管理</title>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- layui -->
    <link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="../css/memberList.css" />
</head>
<body>
<div class="memberlist">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">会员管理</li>
        </ul>
        <div class="layui-tab-content">
            <!--搜素会员列表-->
            <div class="layui-tab-item layui-show">
                <div class="layui-form">
                    <div class="layui-form-item on">
                        <label class="layui-form-label">用户名:</label>
                        <div class="layui-input-inline">
                            <input type="text" name="title" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input  search_userName">
                        </div>
                    </div>
                    <div class="layui-form-item on">
                        <label class="layui-form-label">手机号:</label>
                        <div class="layui-input-inline">
                            <input type="text" name="phone"  placeholder="请输入手机号" class="layui-input search_phone">
                        </div>
                    </div>
                    <div class="layui-form-item on">
                        <label class="layui-form-label ">开始时间:</label>
                        <div class="layui-input-inline">
                            <input type="text" name="startTime"  placeholder="请输入开始时间" class="layui-input search_startTime">
                        </div>
                    </div>
                    <div class="layui-form-item on">
                        <label class="layui-form-label ">结束时间:</label>
                        <div class="layui-input-inline">
                            <input type="text" name="endtTime"  placeholder="请输入结束时间" class="layui-input  search_endTime">
                        </div>
                    </div>
                    <div class="layui-form-item on">
                        <label class="layui-form-label">qq:</label>
                        <div class="layui-input-inline">
                            <input type="text" name="qq"  placeholder="请输入qq" class="layui-input search_qq">
                        </div>
                    </div>
                    <div class="layui-form-item on">
                        <label class="layui-form-label">等级:</label>
                        <div class="layui-input-inline">
                            <select  name="search_level" lay-verify="" class="search_level">
                                <option value="">请选择类型</option>
                                <option value="" selected="">全部</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item member_search on ">
                        <div class="layui-input-inline">
                            <button class="layui-btn  layui-btn btn-primary">搜索</button>
                        </div>
                    </div>
                    <div class="layui-form-item member_increase on">
                        <div class="layui-input-inline">
                            <button class="layui-btn  layui-btn btn-primary">增加</button>
                        </div>
                    </div>
                </div>
            <table class="layui-table">
                    <thead style="text-align: center">
                    <tr>
                        <th>用户名</th>
                        <th>手机号</th>
                        <th>IP地址</th>
                        <th>等级</th>
                        <th>创建时间</th>
                        <th>qq</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody  id="memberList_content" ></tbody>
                </table>

            </div>
        </div>
    </div>
    <div id="pageDemo" style="text-align: center"></div>
</div>
<!--新增会员列表-->
<div class="increase_memberlist" style="display: none">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">新增会员</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item  layui-show form-container">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <div class="use_tips">*必填</div>
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block">
                            <input type="text" name="username" value="" required="" lay-verify="required" placeholder="请输入用户名 (2-12位字符)" class="layui-input memberUserName">
                        </div>

                    </div>
                    <div class="layui-form-item">
                        <div class="ph_tips">*必填</div>
                        <label class="layui-form-label">手机号</label>
                        <div class="layui-input-block">
                            <input type="text" name="memberPhone" value="" required="" lay-verify="required" placeholder="请输入手机号" class="layui-input memberPhone">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="pwd_tips">*必填</div>
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-block">
                            <input type="password" name="password" value="" required="" lay-verify="required" placeholder="请输入密码 (6-16位字符)" class="layui-input memberPassword">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">qq</label>
                        <div class="layui-input-block">
                            <input type="text" name="memberQQ" value="" required="" lay-verify="required" placeholder="请输入qq" class="layui-input memberQQ">
                        </div>
                    </div>
                    <div class="layui-form-item level-item" style="line-height:36px;">
                        <label class="layui-form-label">等级</label>
                        <div class="layui-input-block">
                            <select class="memberLever">

                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn memberSave" >保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary memberReset" >重置</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--会员编辑列表-->
<div class="editor_memberlist" style="display:none;margin-left:15px">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">编辑会员</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item  layui-show form-container editor_form">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block">
                            <input type="text" name="username" value="" required="" disabled lay-verify="required" placeholder="请输入用户名 (2-12位字符)" class="layui-input editor_memberUserName">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机号</label>
                        <div class="layui-input-block">
                            <input type="text" name="memberPhone" value="" required="" disabled  lay-verify="required" placeholder="请输入手机号" class="layui-input editor_memberPhone">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">qq</label>
                        <div class="layui-input-block">
                            <input type="text" name="memberQQ" value="" required=""disabled  lay-verify="required" placeholder="请输入qq" class="layui-input editor_memberQQ">
                        </div>
                    </div>
                    <div class="layui-form-item level-item" style="line-height:36px;">
                        <label class="layui-form-label">等级</label>
                        <div class="layui-input-block  chose_level">
                            <select  class="editor_memberLever">

                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn editor_memberSave" >保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary  editor_memberReset" >重置</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    <script type="text/javascript" src="../lib/js/jquery-1.12.2.min.js"></script>
    <script type="text/javascript" src="../lib/js/system-config.js"></script>
    <script type="text/javascript" src="../lib/layui/layui.js"></script>
    <script type="text/javascript" src="../lib/js/jsrender-min.js"></script>
    <script type="text/javascript" src="../lib/js/easy.ajax.js"></script>
    <script type="text/javascript" src="../js/memberList.js"></script>
    <script type="text/x-jsrender" id="userMemberTpl">
        <tr id="{{:id}}">
            <td class="name">{{:name}}</td>
            <td class="phone">{{:phone}}</td>
            <td class="ip">{{:ipAddress}}</td>
            <td class="editorLevel">{{:level}}</td>
            <td>{{:createTime}}</td>
            <td class="qq">{{:qq}}</td>
            <td>
                <a href="#" class="layui-btn layui-btn layui-btn-mini member_editor">编辑</a>
                <a href="#" class="layui-btn layui-btn-danger layui-btn-mini member_delet">删除</a>
            </td>
        </tr>
    </script>
    <!--创建搜索等级下拉菜单模板-->
    <script type="text/x-jsrender" id="searchTpl">
             <option value="{{:name}}" >{{:name}}</option>
    </script>
    <!--创建增加会员等级下拉菜单模板-->
    <script type="text/x-jsrender" id="levelTpl">
                {{if #index==9}}
                    <option value="{{:name}}" selected>{{:name}}</option>
                    {{else}}
                    <option value="{{:name}}" >{{:name}}</option>
                    {{/if}}
    </script>
    <!--创建编辑等级下拉菜单模板-->
    <script type="text/x-jsrender" id="editor_levelTpl">
        <option value="{{:name}}">{{:name}}</option>
     </script>
    <script type="text/javascript">
        layui.use(['layer','element','laydate'], function(){
            var layer = layui.layer,
                    element = layui.element(),
                     laydate = layui.laydate;
            var start = {
                max: laydate.now(),
                istime: true,
                istoday: true,
                elem: this,
                format: 'YYYY/MM/DD hh:mm:ss',
                choose: function(datas){
                    end.min = datas; //开始日选好后，重置结束日的最小日期
                    end.start = datas+1;//将结束日的初始值设定为开始日
                }
            };
            var end = {
                max: laydate.now(),
                elem: this,
                format: 'YYYY/MM/DD hh:mm:ss',
                istime: true,
                istoday:false,
                choose: function(datas){
                    start.max = datas; //结束日选好后，重置开始日的最大日期
                }
            };
            $(".search_startTime").click(function(){
                start.elem = this;
                laydate(start);
            });
            $(".search_endTime").click( function(){
                end.elem = this
                laydate(end);
            });
        });
    </script>
</body>
</html>